Apply - 25
This assignment accepts allocation instructions from the user or the configuror and one or more MoneyTypes. The MoneyType values must be positive. The total added to all funds must match the sum of MoneyTypes plus the distribution among funds for each MoneyType must match the MoneyType value.
A. Order the allocation funds
- Without the AssignmentProcessing rule or with the rule and order is "Default", no specific order.
- With the AssignmentProcessing rule, order is dictated by rule's configuration: FundGUID, FundName/ascending, descending/case sensitive, insensitive.
B. For each MoneyType with a non-zero value
- For each fund in the order above
- Calculate "added amount" by allocation method
- Units,
- "step 1" = units X the day's unit value, rounded to 10 decimal places
- "step 2" = "step 1" / sum of "added amounts" rounded to 16 decimal places
- "added amount" = "step 2" X sum of the MoneyType values
- Percent, "added amount" = allocation percent X sum of the MoneyType values.
- Amount, "added amount" = amount of the allocation.
- Units,
- "Added amounts" are rounded to the currency definition.
"Adjustment" = unrounded "added amount" - rounded "added amount".
Accumulate "adjustment" for later use.
- Apply the accumulated "adjustment" to the last allocated fund and round to the currency definition.
- Calculate "added amount" by allocation method
- For each fund with a rounded "added amount",
- Calculate "PercentInAllocation" as fund's rounded "added amount" / sum of all money type values.
- Round "PercentInAllocation" to 16 decimal places.
C. For each non-zero value MoneyType in the order configured,
- If the last non-zero value MoneyType
- Order the allocation funds and for each fund,
- Calculate the amount to add to the fund as the difference of fund's "added amount" and the fund's "distributed amount".
- Order the allocation funds and for each fund,
- otherwise, for each fund in the previous order,
- Calculate the amount to add to the fund per MoneyType and round to the currency definition: "percent in allocation" X current money type value..
- Last fund receives any adjustment necessary to balance to the MoneyType value.
- If the last fund cannot accept a rounding adjustment because it is capped by the fund's "added amount", reverse the direction of access to the funds and decrease the rounding adjustments by what rounding adjustment the fund may accept without exceeding its cap.
- Add the amount to the fund's "distributed amount".
D. If tracking funds by deposit,
- For each "added amount",
- A new DepositValuationEffect record persists the amount of change in a fund’s value and maintains tracking by seed deposit (this activity), money type code and the activity’s effective date (new deposit date).
- An ending DepositValue record is created to reflect the ending balances of the deposit's CashValue, RawCashValue and Units.
- An ending record will exist for every beginning DepositValue record and for each new deposit added by the activity.
- Units on variable funds is calculated as the amount added to each fund per money type / the effective date's NAV.
- The number of units is truncated according to the PrescisionValues rule configuration or the default of 10 decimal places.
- New deposits maintain tracking by seed deposit, money type code and deposit date (date of investment in the fund).
- An ending FundValue record is created to reflect the ending balances of the fund's CashValue, RawCashValue and Units.
- If rounding level is deposit, CashValue is the sum of rounded cash value from the fund's ending DepositValue records.
- If rounding level is fund, CashValue is the sum of unrounded cash value from the fund's ending DepositValue records. The result is rounded to currency definition.
- Units and RawCashValue are the sum of the units and raw cash values, respectively, from the fund's ending DepositValue records.
E. If not tracking funds by deposit,
- A FundValuationEffect record persists the amount of change in a fund’s value.
F. An ending FundValue record is created to reflect the fund's ending balances.
- An ending record will exist for every beginning FundValue record and for each new investment position added by the activity.
- The difference between beginning and ending record values is the the fund's changes persisted in the FundValuationEffect record.